package com.fishery.authority.service;

import com.fishery.entity.Result;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.Map;

/**
 * @author 白sa能
 * @className
 * @date Created in 4:30 PM 1/16/21
 * @package com.fishery.ucenter.service
 * @Description
 */
public interface CaptchaService {
    /**
     * 生成验证码
     *
     * @param ipAddress
     * @return
     * @throws IOException
     */
    Map<String, Object> createVerificationCode(String ipAddress) throws IOException;

    /**
     * 删除验证码
     *
     * @param ipAddress
     * @return
     */
    Result deleteVerificationCode(String ipAddress);

    /**
     *  修改验证码
     *
     * @param request
     * @param phone
     * @return
     */
    Result changeVerificationCode(HttpServletRequest request, String phone);

    /**
     * 检查验证码是否正确
     *
     * @param request
     * @param code
     * @return
     */
    boolean checkVerificationCode(HttpServletRequest request, String code);
}
